<% content_for :atom, auto_discovery_link_tag(:atom, home_url({format: "atom", api_key: current_user.api_key})) %>
<div class="row">
  <div class="col-sm 6 col-md-8">
    <% if @versions.length > 0 %>
      <%= render collection: @versions, partial: 'dashboard/new_version', as: :version  %>
      <p>
        <small class='text-muted'>
          <% if current_user.muted_projects.length > 0 %>
            <% if params[:include_muted].present? %>
              Showing <%= pluralize current_user.muted_projects.length, 'muted project' %> -
              <%= link_to 'Hide muted packages', url_for(params.except(:include_muted).permit!) %> -
            <% else %>
              Not showing <%= pluralize current_user.muted_projects.length, 'muted project' %> -
              <%= link_to 'Show muted packages', url_for(params.except(:host).merge(include_muted: true).permit!) %> -
            <% end %>
            <%= link_to 'Manage muted packages', muted_path %> -
          <% end %>
          <%= link_to 'Manage your subscriptions', subscriptions_path %>
        </small>
      </p>
      <p>
        <small>
          <%= link_to home_url({format: "atom", api_key: current_user.api_key}) do %>
            <%= fa_icon "rss-square" %>
            Subscribe to an RSS feed of new versions
          <% end %>
        </small>
      </p>
    <% else %>
      <h2>Hi there <%= current_user %>!</h2>
      <p>
        Libraries.io lets you watch packages that you depend on and notifies you when there's a new release.
        When you follow a package, new releases will show up here in your newsfeed.
      </p>
      <%= render 'dashboard/monitoring_promo' %>
    <% end %>
  </div>
  <div class="col-md-4">
    <% if @versions.length > 0 %>
      <h3>Repository Monitoring</h3>
      <%= render 'dashboard/monitoring_promo' %>
    <% end %>
  </div>
</div>
